package xixirupan.tmgp.tencent.com.vmeim.ui.beautyshop.view;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.GridLayoutManager;
import android.util.Log;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.sch.rfview.AnimRFRecyclerView;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;
import xixirupan.tmgp.tencent.com.vmeim.R;
import xixirupan.tmgp.tencent.com.vmeim.ui.beautyshop.presenter.CatgoryDetailAdapter;
import xixirupan.tmgp.tencent.com.vmeim.ui.beautyshop.presenter.CatgoryDetailPresenter;

public class DetailCatgoryActivity extends AppCompatActivity {

    @BindView(R.id.category_detail_search)
    EditText categoryDetailSearch;
    @BindView(R.id.changeMangaer_icon)
    ImageView changeMangaerIcon;
    @BindView(R.id.goback_catogrydetail)
    ImageView gobackCatogrydetail;
    @BindView(R.id.zonghe_detail)
    TextView zongheDetail;
    @BindView(R.id.xiaoliang)
    TextView xiaoliang;
    @BindView(R.id.zuixin)
    TextView zuixin;
    @BindView(R.id.price)
    TextView price;
    @BindView(R.id.select)
    TextView select;
    @BindView(R.id.linear_top)
    LinearLayout linearTop;
    @BindView(R.id.line)
    TextView line;
    @BindView(R.id.detail_category_recyclerview)
    AnimRFRecyclerView detailCategoryRecyclerview;
    @BindView(R.id.activity_detail_catgory)
    RelativeLayout activityDetailCatgory;


    private Unbinder bind;
    private Context context;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_detail_catgory);
         bind = ButterKnife.bind(this);
        context =this;
        Intent intent = getIntent();
        String cid = intent.getStringExtra("cid");
        CatgoryDetailPresenter presenter =new CatgoryDetailPresenter(detailCategoryRecyclerview,getLayoutInflater(),context);
        presenter.getData(cid);

    }

    @OnClick({R.id.category_detail_search, R.id.changeMangaer_icon, R.id.goback_catogrydetail, R.id.zonghe_detail, R.id.xiaoliang, R.id.zuixin, R.id.price, R.id.select})
    public void onClick(View view) {
        switch (view.getId()) {
            //搜索框
            case R.id.category_detail_search:

                break;
            //改变布局按钮
            case R.id.changeMangaer_icon:
                detailCategoryRecyclerview.setLayoutManager(new GridLayoutManager(context,2));
                break;
            //返回按钮
            case R.id.goback_catogrydetail:
                finish();
                break;
            //综合按钮
            case R.id.zonghe_detail:
                break;
            //销量阿牛
            case R.id.xiaoliang:
                break;
            //最新
            case R.id.zuixin:
                break;
            //价格
            case R.id.price:
                break;
            //帅选
            case R.id.select:
                break;
        }
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        bind.unbind();
    }
}
